package com.ruoyi.business.service.impl;

import java.util.List;

import com.ruoyi.business.domain.BusinessOrg;
import com.ruoyi.business.mapper.BusinessOrgMapper;
import com.ruoyi.business.service.IBusinessOrgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 机构信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-11-23
 */
@Service
public class BusinessOrgServiceImpl implements IBusinessOrgService
{
    @Autowired
    private BusinessOrgMapper businessOrgMapper;

    /**
     * 查询机构信息
     * 
     * @param orgId 机构信息主键
     * @return 机构信息
     */
    @Override
    public BusinessOrg selectBusinessOrgByOrgId(Long orgId)
    {
        return businessOrgMapper.selectBusinessOrgByOrgId(orgId);
    }

    /**
     * 查询机构信息列表
     * 
     * @param businessOrg 机构信息
     * @return 机构信息
     */
    @Override
    public List<BusinessOrg> selectBusinessOrgList(BusinessOrg businessOrg)
    {
        return businessOrgMapper.selectBusinessOrgList(businessOrg);
    }

    /**
     * 新增机构信息
     * 
     * @param businessOrg 机构信息
     * @return 结果
     */
    @Override
    public int insertBusinessOrg(BusinessOrg businessOrg)
    {
        return businessOrgMapper.insertBusinessOrg(businessOrg);
    }

    /**
     * 修改机构信息
     * 
     * @param businessOrg 机构信息
     * @return 结果
     */
    @Override
    public int updateBusinessOrg(BusinessOrg businessOrg)
    {
        return businessOrgMapper.updateBusinessOrg(businessOrg);
    }

    /**
     * 批量删除机构信息
     * 
     * @param orgIds 需要删除的机构信息主键
     * @return 结果
     */
    @Override
    public int deleteBusinessOrgByOrgIds(String orgIds)
    {
        return businessOrgMapper.deleteBusinessOrgByOrgIds(Convert.toStrArray(orgIds));
    }

    /**
     * 删除机构信息信息
     * 
     * @param orgId 机构信息主键
     * @return 结果
     */
    @Override
    public int deleteBusinessOrgByOrgId(Long orgId)
    {
        return businessOrgMapper.deleteBusinessOrgByOrgId(orgId);
    }

    @Override
    public BusinessOrg selectBusinessOrgByUserAndPwd(String userName, String password) {
        return businessOrgMapper.selectBusinessOrgByUserAndPwd(userName, password);
    }
}
